{literal}
<style>
	#notify-table {
		position: fixed;
		width: 100%;
		z-index: 100;
		font-family: Arial, "Liberation Sans", "DejaVu Sans", sans-serif;
		font-size: 80%;
		font-weight: normal;
		letter-spacing: 1px;
		overflow: hidden;
		visibility: hidden;
	}
	
	#notify-table a{ 
		text-decoration: none;
		font-family: Arial, "Liberation Sans", "DejaVu Sans", sans-serif;
		font-weight: normal;
		letter-spacing: 1px;
	}

	table#notify-table { 
		border-collapse: collapse;
		border-spacing: 0px;
	}
	.notify-close {text-align: right;}
</style>
{/literal}
<div id="notify-container">
	<table id="notify-table">
		<tbody>
			<tr id="notify--1" class="notify" style="">
				<td class="notify" align="center">
				Projektowanie stron www, szablony www, szablony allegro.pl - zapraszamy - <a href="http://21w.pl">www.21w.pl</a>
				</td>
				<td class="notify-close">
					<a title="dismiss this notification" onclick="$('#notify-container').css({ldelim}'display': 'none'{rdelim});">[x]</a>
				</td>
			</tr>
		</tbody>
	</table>
</div>

{literal}
<script>
$(document).ready(function() {
	
	col = hex2rgb($('body').css("background-color"));
	$('#notify-container').css("background-color",rgb2hex("rgb("+recolor(col,10)+")"));
	$('#notify-container').css("color",rgb2hex("rgb("+recolor(col,60)+")"));
	$('#notify-container a').css("color",rgb2hex("rgb("+recolor(col,60)+")"));
	$('#notify-table').css("visibility","visible");
	
	function recolor(col,re){
		col[0] = ( 127 > col[0] && col[0] > re ) ? col[0] + re : col[0] - re;
		col[1] = ( 127 > col[1] && col[1] > re ) ? col[1] + re : col[1] - re;
		col[2] = ( 127 > col[2] && col[2] > re ) ? col[2] + re : col[2] - re;
		return col;
	}
	
	function hex2rgb( hex ) {
		if(hex.match("#")) hex = hex.substring(1,7);
        else return hex;
        if ( hex.length == 6 ) {
            r = hex[0] + hex[1];
            g = hex[2] + hex[3];
            b = hex[4] + hex[5];
        } else if ( hex.lenght == 3 ) {
            r = hex[0] + hex[0];
            g = hex[1] + hex[1];
            b = hex[2] + hex[2];
        } else {
            return false;
        }       
        r = parseInt(r.toUpperCase(),16 );
        g = parseInt(g.toUpperCase(),16 );
        b = parseInt(b.toUpperCase(),16 );
        return new Array(r,g,b);
	}	

	function rgb2hex(rgb) {  
		if(rgb.match("#")) return rgb;
		rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
		function hex(x) {  
			hexDigits = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");  
			return isNaN(x) ? "00" : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16];  
		}		
		return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);  
	} 	

	var Constant= 100; //100 px

    
    $(window).resize(function() {
        var x= $(window).attr("innerWidth");
        var y= $(window).attr("innerHeight");
       
        $("#notify-table").trigger("DisplayNoneEvent", [x,y]);
    });

    $("#notify-table").bind("DisplayNoneEvent", function(x, y) {
        var top, left, divwidth, divheight;
        top= this.css("top");
        left= this.css("left");
        divwidth= parseInt(this.css("width"));
        if (top + divwidth > x + Constant) {
                $("#notify-table").css({
                        "display": "none"
                });
        } else {
                divheight= parseInt(this.css("height"));
                if (left + divheight > y + Constant) {
                        this.css({
                                "display": "none"
                        });
                }
                else {
                        this.css({
                                "display": "block"
                        });
                }
        }
    })
   $(window).trigger("resize"); 
   /* the previous line might not be necessary, I'm not sure. It triggers 
    the event once on pageload */
});
</script>
{/literal}